package com.yupi.usercenter.service;

import com.yupi.usercenter.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
* @author hehe
* @description 针对表【user】的数据库操作Service
* @createDate 2024-04-12 23:43:10
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @param checkPassword 确认密码
     * @return 用户id
     */
    long userRegister(String userAccount,String userPassword,String checkPassword,String plantCode) throws NoSuchAlgorithmException;

    /**
     * 用户登录
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @return 脱敏后的信息
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    boolean deleteUser(long id);

    /**
     * 用户注销
     *
     */
    int userLogout(HttpServletRequest request);

    User getSafetyUser(User user);
}
